//////////////////////////////////////////////////
// main.cpp
//
// Author: Tarik Belabbas et Adrien Hoffer
//////////////////////////////////////////////////

#include <QApplication>

#include "gl/glRenderer.h"
#include "gui/guiQtWindow.h"
#include "gl/particles/glParticleManager.h"

int		initializeApplication	( int _argc, char** _argv );
void	exitApplication			();

//------------------------------------------------------------------------------
int main( int _argc, char** _argv )
{
	srand( time( 0 ) );

	int result = initializeApplication( _argc, _argv );

	exitApplication();

	return result;
}

//------------------------------------------------------------------------------
int initializeApplication( int _argc, char** _argv )
{
	// Initialize singletons
	glRenderer::s_create();
	glParticleManager::s_create();

	// Initialize GUI
	QApplication app( _argc, _argv );
	guiQtWindow window;

	//window.show();
	window.showMaximized();
	//window.showFullScreen();

	return app.exec();
}

//------------------------------------------------------------------------------
void exitApplication()
{
	// Destroying singletons
	glParticleManager::s_destroy();
	glRenderer::s_destroy();
}

/*#include "gui/qtopengl_to52.h"

#include <QtGui>
#include <QApplication>

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    QtOpenGL_TO52 w;
    w.show();
    return a.exec();
}*/
